//
//  FlexibleFrame.m
//  test
//
//  Created by rimi1 on 15/6/26.
//  Copyright (c) 2015年 TJ. All rights reserved.
//

#import "FlexibleFrame.h"
#define SCREEN_SIZE  [UIScreen mainScreen].bounds.size

#define IPHONE5_SIZE CGSizeMake(320,568)

@implementation FlexibleFrame

+ (CGFloat)ratio{
    
    return SCREEN_SIZE.height/IPHONE5_SIZE.height;
}

+(CGRect)frameWithIPhone5Frame:(CGRect)IPhone5Frame{
    
    CGFloat x = IPhone5Frame.origin.x * [self ratio];
    CGFloat y = IPhone5Frame.origin.y * [self ratio];
    CGFloat width = IPhone5Frame.size.width * [self ratio];
    CGFloat height = IPhone5Frame.size.height * [self ratio];
    
    return CGRectMake(x, y, width, height);
}

@end
